aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/fund/[id]/withdraw
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-07 21:16:25 -0800
committerAdam Soltys <[email protected]>2024-11-08 09:27:40 -0800
commit32fcc461cd43c8907df5e306d520bb671307eab1 (patch)
tree0253780c569998b6c1a5f43026586e94916c3fee /src/routes/(app)/fund/[id]/withdraw
parentbe5aa52cea1d57c875cfb22d25c6a866b8de2239 (diff)
downloadcoinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.tar.gz
coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.zip
svelte 5
Diffstat (limited to 'src/routes/(app)/fund/[id]/withdraw')
-rw-r--r--src/routes/(app)/fund/[id]/withdraw/+page.svelte24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/routes/(app)/fund/[id]/withdraw/+page.svelte b/src/routes/(app)/fund/[id]/withdraw/+page.svelte
index 0ad3c2cf..89654d23 100644
--- a/src/routes/(app)/fund/[id]/withdraw/+page.svelte
+++ b/src/routes/(app)/fund/[id]/withdraw/+page.svelte
@@ -1,4 +1,6 @@
<script>
+ import { run } from 'svelte/legacy';
+
import { t } from "$lib/translations";
import { enhance } from "$app/forms";
import Icon from "$comp/Icon.svelte";
@@ -8,25 +10,29 @@
import { back } from "$lib/utils";
import { pin } from "$lib/store";
- export let data;
- export let form;
+ let { data, form } = $props();
let { rates } = data;
- let { amount, id } = $page.params;
- let { currency } = data.user;
- let loading;
+ let { amount, id } = $state($page.params);
+ let { currency } = $state(data.user);
+ let loading = $state();
let submit = () => (loading = true);
- $: update(form);
let update = () => {
if (form?.message.includes("pin")) $pin = undefined;
loading = false;
};
- $: rate = rates[currency];
+ run(() => {
+ update(form);
+ });
+ let rate;
+ run(() => {
+ rate = rates[currency];
+ });
</script>
-<button class="ml-5 md:ml-20 mt-5 md:mt-10 hover:opacity-80" on:click={back}>
+<button class="ml-5 md:ml-20 mt-5 md:mt-10 hover:opacity-80" onclick={back}>
<Icon icon="arrow-left" style="w-10" />
</button>
@@ -39,7 +45,7 @@
<div class="container px-4 mt-20 max-w-xl mx-auto">
<Numpad bind:amount bind:currency bind:rate />
- <form method="POST" use:enhance on:submit={submit}>
+ <form method="POST" use:enhance onsubmit={submit}>
<input name="id" value={id} type="hidden" />
<input name="amount" value={amount} type="hidden" />
<input name="pin" value={$pin} type="hidden" />